import React, { PureComponent } from "react";
import RootSiblingsManager from "react-native-root-siblings";
import LoadingSpinner from "../Widgets/LoadingSpinner";

let siblings = undefined;

export default LoadingUtil = {
  showLoading:()=>{
      if(siblings instanceof RootSiblingsManager) {
          siblings.destroy();
      }
      siblings = new RootSiblingsManager(<LoadingSpinner visible={true}/>);
  },
  dismissLoading:()=>{
      if(siblings instanceof RootSiblingsManager) {
          siblings.destroy();
      }
  }
}
